<template>
  <div class="bottom">
    <div class="btn" :class="{ active: !disabled }" @click="handleClick">
      提交
    </div>
  </div>
</template>

<script>
export default {
  name: 'SubmitBtn',
  props: {
    disabled: {
      type: Boolean,
      default: true,
    },
  },
  methods: {
    handleClick() {
      if (this.disabled) {
        return
      }
      this.$emit('submit')
    },
  },
}
</script>

<style lang="scss" scoped>
.bottom {
  position: fixed;
  z-index: 9;
  padding-top: 20px;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: #fff;
  left: 0;
  bottom: 0;
  right: 0;

  .btn {
    width: 280px;
    height: 36px;
    text-align: center;
    line-height: 36px;
    border-radius: 19px;
    background: #ccc;
    margin: 0 auto 20px;
    color: #fff;
    font-size: 16px;

    &.active {
      background: linear-gradient(180deg, #0c5fb3 0%, #337fb9 100%);
    }
  }
}
</style>
